package com.coin.exchange.bithumb.api;

/**
 * Private API
 * 每秒可申请10次。
 * 如果申请次数超过10次，5分钟内API的使用将会受限，
 * @author duyuchong
 *
 */
public interface BithumbPrivateApi {

	/**
	 * bithumb交易所会员信息
	 * @param apiKey
	 * @param secretKey
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getAccount(String apiKey, String secretKey, String currency) throws Exception;
	
	/**
	 * bithumb交易所会员钱包信息
	 * @param apiKey
	 * @param secretKey
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getBalance(String apiKey, String secretKey, String currency) throws Exception;
	
	/**
	 * bithumb交易所会员存款地址
	 * @param apiKey
	 * @param secretKey
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getWalletAddress(String apiKey, String secretKey, String currency) throws Exception;
	
	/**
	 * 会员最后交易信息
	 * @param apiKey
	 * @param secretKey
	 * @param order_currency
	 * @param payment_currency: KRW (目前在bithumb提供的货币KRW)
	 * @return
	 * @throws Exception
	 */
	String getTicker(String apiKey, String secretKey, String order_currency, String payment_currency) throws Exception;
	
	/**
	 * 销售/购买交易订单登记或进行中的交易
	 * @param apiKey
	 * @param secretKey
	 * @param order_id: 销售/购买登记的订单号码
	 * @param type: 交易类型(bid : 购买，ask : 销售)
	 * @param count: Value : 1 ~1000 (default : 100)
	 * @param after: YYYY-MM-DD hh:mm:ss's UNIX Timestamp
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getOrders(String apiKey, String secretKey, String order_id, String type, Integer count, Long after, String currency) throws Exception;
	
	/**
	 * 会员交易明细
	 * @param apiKey
	 * @param secretKey
	 * @param offset: Value : 0 ~ (default : 0)
	 * @param count: Value : 1 ~ 50 (default : 20)
	 * @param searchGb: 0 : 全部, 1 : 购买完毕, 2 : 销售完毕, 3 : 取款中, 4 : 存款, 5 : 取款, 9 : KRW存款中
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getUserTransactions(String apiKey, String secretKey, Integer offset, Integer count, Integer searchGb, String currency) throws Exception;
	
	/**
	 * bithumb会员销售/购买签订明细
	 * @param apiKey
	 * @param secretKey
	 * @param order_id: 销售/购买登记的订单号码
	 * @param type: 交易类型(bid : 购买，ask : 销售)
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String getOrderDetail(String apiKey, String secretKey, String order_id, String type, String currency) throws Exception;
	
	/**
	 * bithumb会员销售/购买交易订单登记及签订
	 * @param apiKey
	 * @param secretKey
	 * @param order_currency
	 * @param payment_currency: KRW (基本值)
	 * @param units: 订单数量
	 * @param price: 每1Currency交易金额
	 * @param type: 交易类型(bid : 购买，ask : 销售)
	 * @return
	 * @throws Exception
	 */
	String place(String apiKey, String secretKey, String order_currency, String payment_currency, Float units, Integer price, String type) throws Exception;
	
	/**
	 * bithumb会员销售/购买交易取消
	 * @param apiKey
	 * @param secretKey
	 * @param type: 交易类型(bid : 购买，ask : 销售)
	 * @param order_id: 销售/购买登记的订单号码
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String cancel(String apiKey, String secretKey, String type, String order_id, String currency) throws Exception;
	
	/**
	 * 市场价购买
	 * @param apiKey
	 * @param secretKey
	 * @param units: 订单数量
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String marketBuy(String apiKey, String secretKey, Float units, String currency) throws Exception;
	
	/**
	 * 市场价销售
	 * @param apiKey
	 * @param secretKey
	 * @param units: 订单数量
	 * @param currency
	 * @return
	 * @throws Exception
	 */
	String marketSell(String apiKey, String secretKey, Float units, String currency) throws Exception;
	
}
